3.15.49 \(\int (1+x)^m (1+2 x+x^2)^n \, dx\) [1449]

Optimal. Leaf size=26 \[ \frac {(1+x)^{1+m} \left (1+2 x+x^2\right )^n}{1+m+2 n} \]

[Out]

(1+x)^(1+m)*(x^2+2*x+1)^n/(1+m+2*n)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {658, 32} \begin {gather*} \frac {(x+1)^{m+1} \left (x^2+2 x+1\right )^n}{m+2 n+1} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + x)^m*(1 + 2*x + x^2)^n,x]

[Out]

((1 + x)^(1 + m)*(1 + 2*x + x^2)^n)/(1 + m + 2*n)

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rule 658

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Dist[(a + b*x + c*x^2)^p/(d
 + e*x)^(2*p), Int[(d + e*x)^(m + 2*p), x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && EqQ[b^2 - 4*a*c, 0] &&  !
IntegerQ[p] && EqQ[2*c*d - b*e, 0] &&  !IntegerQ[m]

Rubi steps

\begin {align*} \int (1+x)^m \left (1+2 x+x^2\right )^n \, dx &=\left ((1+x)^{-2 n} \left (1+2 x+x^2\right )^n\right ) \int (1+x)^{m+2 n} \, dx\\ &=\frac {(1+x)^{1+m} \left (1+2 x+x^2\right )^n}{1+m+2 n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 23, normalized size = 0.88 \begin {gather*} \frac {(1+x)^{1+m} \left ((1+x)^2\right )^n}{1+m+2 n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + x)^m*(1 + 2*x + x^2)^n,x]

[Out]

((1 + x)^(1 + m)*((1 + x)^2)^n)/(1 + m + 2*n)

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 5 vs. order 3.
time = 0.77, size = 18, normalized size = 0.69

method result size
meijerg \(x \hypergeom \left (\left [1, -m -2 n \right ], \left [2\right ], -x \right )\) \(18\)
gosper \(\frac {\left (x +1\right )^{1+m} \left (x^{2}+2 x +1\right )^{n}}{1+m +2 n}\) \(27\)
norman \(\frac {{\mathrm e}^{m \ln \left (x +1\right )} {\mathrm e}^{n \ln \left (x^{2}+2 x +1\right )}}{1+m +2 n}+\frac {x \,{\mathrm e}^{m \ln \left (x +1\right )} {\mathrm e}^{n \ln \left (x^{2}+2 x +1\right )}}{1+m +2 n}\) \(59\)
risch \(\frac {\left (x +1\right )^{m} \left (x +1\right ) {\mathrm e}^{\frac {n \left (-i \pi \mathrm {csgn}\left (i \left (x +1\right )^{2}\right )^{3}+2 i \pi \mathrm {csgn}\left (i \left (x +1\right )^{2}\right )^{2} \mathrm {csgn}\left (i \left (x +1\right )\right )-i \pi \,\mathrm {csgn}\left (i \left (x +1\right )^{2}\right ) \mathrm {csgn}\left (i \left (x +1\right )\right )^{2}+4 \ln \left (x +1\right )\right )}{2}}}{1+m +2 n}\) \(88\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x+1)^m*(x^2+2*x+1)^n,x,method=_RETURNVERBOSE)

[Out]

x*hypergeom([1,-m-2*n],[2],-x)

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 27, normalized size = 1.04 \begin {gather*} \frac {{\left (x + 1\right )} e^{\left (m \log \left (x + 1\right ) + 2 \, n \log \left (x + 1\right )\right )}}{m + 2 \, n + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+x)^m*(x^2+2*x+1)^n,x, algorithm="maxima")

[Out]

(x + 1)*e^(m*log(x + 1) + 2*n*log(x + 1))/(m + 2*n + 1)

________________________________________________________________________________________

Fricas [A]
time = 2.89, size = 24, normalized size = 0.92 \begin {gather*} \frac {{\left (x + 1\right )}^{m} {\left (x + 1\right )}^{2 \, n} {\left (x + 1\right )}}{m + 2 \, n + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+x)^m*(x^2+2*x+1)^n,x, algorithm="fricas")

[Out]

(x + 1)^m*(x + 1)^(2*n)*(x + 1)/(m + 2*n + 1)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \begin {cases} \frac {x \left (x + 1\right )^{m} \left (x^{2} + 2 x + 1\right )^{n}}{m + 2 n + 1} + \frac {\left (x + 1\right )^{m} \left (x^{2} + 2 x + 1\right )^{n}}{m + 2 n + 1} & \text {for}\: m \neq - 2 n - 1 \\\int \left (x + 1\right )^{- 2 n - 1} \left (\left (x + 1\right )^{2}\right )^{n}\, dx & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+x)**m*(x**2+2*x+1)**n,x)

[Out]

Piecewise((x*(x + 1)**m*(x**2 + 2*x + 1)**n/(m + 2*n + 1) + (x + 1)**m*(x**2 + 2*x + 1)**n/(m + 2*n + 1), Ne(m
, -2*n - 1)), (Integral((x + 1)**(-2*n - 1)*((x + 1)**2)**n, x), True))

________________________________________________________________________________________

Giac [A]
time = 1.96, size = 37, normalized size = 1.42 \begin {gather*} \frac {{\left (x + 1\right )}^{m} {\left (x + 1\right )}^{2 \, n} x + {\left (x + 1\right )}^{m} {\left (x + 1\right )}^{2 \, n}}{m + 2 \, n + 1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+x)^m*(x^2+2*x+1)^n,x, algorithm="giac")

[Out]

((x + 1)^m*(x + 1)^(2*n)*x + (x + 1)^m*(x + 1)^(2*n))/(m + 2*n + 1)

________________________________________________________________________________________

Mupad [B]
time = 0.59, size = 26, normalized size = 1.00 \begin {gather*} \frac {{\left (x+1\right )}^{m+1}\,{\left (x^2+2\,x+1\right )}^n}{m+2\,n+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x + 1)^m*(2*x + x^2 + 1)^n,x)

[Out]

((x + 1)^(m + 1)*(2*x + x^2 + 1)^n)/(m + 2*n + 1)

________________________________________________________________________________________